fix(wall): bound CPED freelist with dynamic budget + hysteresis#258
fix(wall): bound CPED freelist with dynamic budget + hysteresis#258
Conversation
This implement a lower and upper bound to match different user load situations. Refs: DataDog/dd-trace-js#7355
This verifies that it fails before and is fixed with the change.
Overall package sizeSelf size: 1.79 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | source-map | 0.7.6 | 185.63 kB | 185.63 kB | | pprof-format | 2.2.1 | 163.06 kB | 163.06 kB | | p-limit | 3.1.0 | 7.75 kB | 13.78 kB | | delay | 5.0.0 | 11.17 kB | 11.17 kB | | node-gyp-build | 3.9.0 | 8.81 kB | 8.81 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2026-02-03 17:06:10 Comparing candidate commit e3edd0c in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 89 metrics, 30 unstable metrics. scenario:profiler-light-load-with-wall-profiler-22
|
|
👋 @BridgeAR thanks for making this PR - invested onlooker from the linked issue here. Trying to figure out if this will fix things on our app. Could you provide a bit more detail about what the problem was and how it was fixed? Was this only Node 24? Was there a specific commit that caused this to start happening? etc. Thank you! |
|
hey @RDIL, the relevant dd-trace-js commit that enabled this behavior is DataDog/dd-trace-js#7119. It's on by default on Node.js 24+. (It will also be turned on on Node.js 22-23 but only when running Node.js with explicit If you need a workaround urgently, you can revert to older behavior on Node.js 24+ by setting |
|
#255 will make this obsolete, as the rework I did there made the freelist not feasible anymore. (FWIW, malloc itself manages a freelist, so I'm not even sure if this measure effectively fought memory fragmentation at all.) In that PR, I started using Node.js standard Anyhow, we can integrate this PR, I'll just have to add its revert as the first commit to #255. |
* fix(wall): bound CPED freelist with dynamic budget + hysteresis This implement a lower and upper bound to match different user load situations. Refs: DataDog/dd-trace-js#7355 * fix(wall): add bounded batch trimming + track dead counts per GC * fix(wall): adapt trim batch with growth/decay + emergency override * test: add memory leak test This verifies that it fails before and is fixed with the change. * fixup!
* fix(wall): bound CPED freelist with dynamic budget + hysteresis This implement a lower and upper bound to match different user load situations. Refs: DataDog/dd-trace-js#7355 * fix(wall): add bounded batch trimming + track dead counts per GC * fix(wall): adapt trim batch with growth/decay + emergency override * test: add memory leak test This verifies that it fails before and is fixed with the change. * fixup!
fix(wall): bound CPED freelist with dynamic budget + hysteresis
This implement a lower and upper bound to match different user
load situations.
fix(wall): add bounded batch trimming + track dead counts per GC
fix(wall): adapt trim batch with growth/decay + emergency override
test: add memory leak test